Synapse Device and Method of Operating the Same